<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>BiwaScheme</title>
    <link href="/website/css/screen.css" rel="stylesheet" type="text/css">
    <link href="/website/css/jquery.terminal-2.3.0.css" rel="stylesheet" type="text/css"></script>
    <link href="/website/css/prism-coy.css" rel="stylesheet" type="text/css"></script>
    <script src="/release/biwascheme-@VERSION@-min.js" type="text/javascript"></script>
    <script src="/website/js/jquery.mousewheel.min.js" type="text/javascript"></script>
    <script src="/website/js/jquery.timers.min.js" type="text/javascript"></script>
    <script src="/website/js/jquery.cookie.min.js" type="text/javascript"></script>
    <script src="/website/js/jquery.terminal-2.3.0.js" type="text/javascript"></script>
    <script src="/website/js/prism.js" type="text/javascript"></script>
    <script src="/website/js/prism-scheme.js" type="text/javascript"></script>
    <script src="/website/js/jquery.terminal.prism.js" type="text/javascript"></script>
    <script src="/website/js/keyboard.js" type="text/javascript"></script>
    <script src="/website/js/biwascheme_terminal.js" type="text/javascript"></script>
  </head>
  <body>
    <a href="https://github.com/biwascheme/biwascheme"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>

    <div id="menu">
      <a href="/index.html">
        <img src="/website/images/biwascheme_logo.png" alt="logo"
             title="BiwaScheme logo by @jcubic">
      </a>
      <ul>
        <li><a href='/doc/features.html'>Features</a></li>
        <li><a href='/doc/getting_started.html'>Getting Started</a></li>
        <li><a href='/doc/reference.html'>Reference</a></li>
        <li><a href='/doc/faq.html'>FAQ</a></li>
        <li><a href='/doc/index.html'>Other docs</a></li>
      </ul>
    </div>
    <div id="content">
<h2 id="getting-started">Getting Started</h2>
<h3 id="html-and-browser">HTML and Browser</h3>
<ol>
<li>Download <a href="../release/biwascheme.js">biwascheme.js</a></li>
<li>Save the following as hello.html and open it</li>
</ol>
<pre><code>&lt;!DOCTYPE html&gt; 
&lt;html&gt; 
  &lt;head&gt; 
    &lt;meta charset=&quot;utf-8&quot; /&gt; 
    &lt;title&gt;BiwaScheme example&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id=&quot;bs-console&quot;&gt;
    &lt;/div&gt;
    &lt;script src=&quot;biwascheme.js&quot;&gt;
      (print &quot;Hello, world!&quot;)
      (print (current-date))
      (console-log &quot;ok.&quot;)
    &lt;/script&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre><p>NOTE: The .js file name must be <code>biwascheme.js</code> or <code>biwascheme-min.js</code> to make the Scheme program to be loaded.</p>
<h3 id="node-js">Node.js</h3>
<p><a name="nodejs" /></p>
<p>There is a npm package of BiwaScheme for Node.js.</p>
<pre><code>$ npm install biwascheme -g
$ biwas
&gt; (+ 1 2)
3
</code></pre><p>Running a script file</p>
<pre><code>$ cat hello.scm
(print &quot;Hello, world!&quot;)
$ biwas hello.scm
Hello, world!
</code></pre><p>Using Node.js functions</p>
<pre><code>(define fs (js-eval &quot;require(&#39;fs&#39;)&quot;))

(define path &quot;.&quot;)
(print (js-invoke fs &#39;readdirSync path))
; Alternatively you can use `..` macro syntax:
; (print (.. fs `(readdirSync ,path)))
</code></pre>    </div>

    <!-- Google Analytics -->
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-2023947-5', 'auto');
      ga('send', 'pageview');
    </script>
  </body>
</html>
